package com.example.careycai.notepad;

import android.content.Context;
import android.text.format.DateFormat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import java.util.Calendar;
import java.util.Date;
import java.util.List;

import static java.util.Calendar.*;

/**
 * Created by julie.zhu on 12/25/2015.
 */
public class Information_entityAdapter extends ArrayAdapter<Information_entity> {

    private int resourceId;

    public Information_entityAdapter(Context context, int textViewResourceId,List<Information_entity> objects) {
        super(context,textViewResourceId, objects);
        resourceId=textViewResourceId;
    }

    @Override
    public long getItemId(int position) {
        return super.getItemId(position);
    }

    @Override
    public View getView(int position,View convertView,ViewGroup parent){
        Information_entity information_entity=getItem(position);
        View view= LayoutInflater.from(getContext()).inflate(resourceId, null);
        TextView title=(TextView)view.findViewById(R.id.title);
        TextView time=(TextView)view.findViewById(R.id.time);
        title.setText(information_entity.getTitle());
        time.setText(information_entity.getTime());
        return view;
    }
}
